
#include "includes.h"
#include "structs.h"
#include "declares.h"

int main(int ac, char**av)
{
        
        FILE *vfile = fopen(av[1], "r");
        FILE *efile = fopen(av[2], "r");
        FILE *rfile = fopen(av[3], "r");
        zlog_init(ZLOG_CONF_PATH);
        
        zlog_category_t *mylog = zlog_get_category("mylog");
        igraph_vector_ptr_t vertices, edges;
        igraph_vector_int_t fragtable;
        my_adjlist_t adjlist;

        zlog_info(mylog,"loading vfile...");
        int vn=vfile2vertices(vfile,1,&vertices);
        zlog_info(mylog,"vfile is loaded");

        zlog_info(mylog,"loading efile...");
        int en=efile2edges(efile,&edges);
        zlog_info(mylog,"efile is loaded");

        zlog_info(mylog,"loaded rfile...");
        rfile2fragtable(rfile,vn, &fragtable);
        zlog_info(mylog,"rfile is loaded");
        

        struct Fragment fragments[4];
        zlog_info(mylog,"loading fragment...");
        load_fragment(
                        4,
                        &vertices,
                        &edges,
                        &fragtable,
                        &adjlist,
                        fragments);
        zlog_info(mylog,"fragment is loaded");

        zlog_info(mylog,"testing getInnerVertex...");
        struct vertex_t *pv;
        struct Fragment *frag=&fragments[0];
        initInnerVertex(frag);
        while(!endInnerVertex(frag))
        {
                print_vertex(stderr,getInnerVertex(frag));
        }
        return 0;
}


